// CSE571 - player.h
// Authors: Jonathan Wald, Daniel Sarfati, Guangle Fan
// Player class holds data for each player/connection on the server side.   

#ifndef PLAYER_H
#define PLAYER_H

#include <vector>
#include <string>
#include <iostream>
#include <fstream>

#include "ace/SOCK_Stream.h"
#include "ace/Message_Queue_T.h"

#include "dealer.h"
#include "dealer-svc-handler.h"
#include "hand.h"

using namespace std;

class Card;
class Game;

class Player {

 public:
  Player();
   string name;
   vector<string> games;
   string game_name;
   bool game_type_received;
   bool discarded_done;
   vector<pair<string,string> > servers;
   
   DealerSvcHandler handler;
   Game* active_game;
   Game* game;
   Hand hand;
   int score;
   bool restarting;
   bool quitting;   
   bool suspended;
   bool inserted;
   
   ~Player();
   void send_card(Card card);
   void send_msg(string misdeal_msg);
   void reset();      
   ACE_Reactor_Mask mask;
   ACE_Message_Queue<ACE_NULL_SYNCH> suspension_queue;

  // Service methods
   virtual int init (int argc, char *argv[]);
   virtual int fini (void);
   virtual int suspend (void);
   virtual int resume (void);
   virtual int info (char **, size_t = 0);

 private:
   
};


#endif
